/*
 * @Descripttion: 
 * @version: 
 * @Author: 高月飞
 * @Date: 2023-11-20 19:25:04
 * @LastEditors: 高月飞
 * @LastEditTime: 2023-11-26 16:14:58
 */
import Mock from 'mockjs'

export default [
  //客户新增
  {
    url: '/api/customer/new',
    method: 'post',
    response: () => {
      return {
        code: 200,
        msg: 'sucess',
        data: {
          "customer_id": 1,
          "customername": "深圳研发科技有限公司",
          "customersex": "未知",
          "customercontact": "张三",
          "customerbirthday": "未知",
          "customerphone": "17688888888",
          "customerprofile": "公司信息待填",
          "customeremail": "zhangsan@example.com",
          "customerarea": "深圳",
          "customerposition": "技术总监",
          "creditcode": "待填",
          "customersource": "电话营销",
          "followupstatus": "初次沟通",
          "customerlevel": "SSS",
          "followuptime": "2013-11-1",
          "intentionalproduct": "笔记本电脑",
          "founder": "张三",
          "followupdepartment": "销售部",
          "remark": "备注信息待填"
        }
      }
    }
  },
  //全部客户
  {
    url: '/api/customer/all',
    method: 'get',
    response: ({ query }) => {
      let page = query.page || 1
      return {
        code: 200,
        msg: 'sucess',
        data: {
          total: 1000,
          ...Mock.mock({
            'customer|12': [{
              'id|+1': page * 10,
              "customername": "@cname",
              "customersex|1": ["男", "女", "未知"],
              "customercontact": "@cname",
              "customerbirthday": "@date",
              "customerphone": /^1[3456789]\d{9}$/,
              "customerprofile": "@csentence",
              "customeremail": /\w{5,10}@[a-z]{5}\.com/,
              "customerarea": "@city",
              "customerposition": "@ctitle",
              "creditcode": "@string('number', 18)",
              "customersource|1": ["电话营销", "网络营销", "推荐"],
              "followupstatus|1": ["初次沟通", "跟进中", "已签约"],
              "customerlevel|1": ["SSS", "AAA", "BBB"],
              "followuptime": "@date('yyyy-MM-dd')",
              "intentionalproduct|1": ["笔记本电脑", "平板电脑", "智能手机"],
              "founder": "@cname", // Random Chinese name for founder
              "followupdepartment|1": ["销售部", "市场部", "技术部"],
              "remark": "@csentence"
            }]
          })

        }
      }
    }
  },
  //导入数据
  {
    url: '/api/customer/import',
    method: 'post',
    response: () => {
      return {
        code: 200,
        msg: 'sucess',
        data: "导入数据成功"
      }
    }
  },
  //公海客户
  {
    url: '/api/customer/sea',
    method: 'get',
    response: ({ query }) => {
      let page = query.page || 1
      return {
        code: 200,
        msg: 'sucess',
        data: {
          total: 1000,
          ...Mock.mock({
            'customer|12': [{
              'id|+1': page * 10,
              "customername": "@cname",
              "customersex|1": ["男", "女", "未知"],
              "customercontact": "@cname",
              "customerbirthday": "@date",
              "customerphone": /^1[3456789]\d{9}$/,
              "customerprofile": "@csentence",
              "customeremail": /\w{5,10}@[a-z]{5}\.com/,
              "customerarea": "@city",
              "customerposition": "@ctitle",
              "creditcode": "@string('number', 18)",
              "customersource|1": ["电话营销", "网络营销", "推荐"],
              "followupstatus|1": ["初次沟通", "跟进中", "已签约"],
              "customerlevel|1": ["SSS", "AAA", "BBB"],
              "followuptime": "@date('yyyy-MM-dd')",
              "intentionalproduct|1": ["笔记本电脑", "平板电脑", "智能手机"],
              "founder": "@cname", // Random Chinese name for founder
              "followupdepartment|1": ["销售部", "市场部", "技术部"],
              "remark": "@csentence"
            }]
          })

        }
      }
    }
  },
  //我的客户
  {
    url: '/api/customer/mine',
    method: 'get',
    response: ({ query }) => {
      let page = query.page || 1
      return {
        code: 200,
        msg: 'sucess',
        data: {
          total: 1000,
          ...Mock.mock({
            'customer|12': [{
              'id|+1': page * 10,
              "customername": "@cname",
              "customersex|1": ["男", "女", "未知"],
              "customercontact": "@cname",
              "customerbirthday": "@date",
              "customerphone": /^1[3456789]\d{9}$/,
              "customerprofile": "@csentence",
              "customeremail": /\w{5,10}@[a-z]{5}\.com/,
              "customerarea": "@city",
              "customerposition": "@ctitle",
              "creditcode": "@string('number', 18)",
              "customersource|1": ["电话营销", "网络营销", "推荐"],
              "followupstatus|1": ["初次沟通", "跟进中", "已签约"],
              "customerlevel|1": ["SSS", "AAA", "BBB"],
              "followuptime": "@date('yyyy-MM-dd')",
              "intentionalproduct|1": ["笔记本电脑", "平板电脑", "智能手机"],
              "founder": "@cname", // Random Chinese name for founder
              "followupdepartment|1": ["销售部", "市场部", "技术部"],
              "remark": "@csentence"
            }]
          })

        }
      }
    }
  },
  //下属客户
  {
    url: '/api/customer/subordinate',
    method: 'get',
    response: ({ query }) => {
      let page = query.page || 1
      return {
        code: 200,
        msg: 'sucess',
        data: {
          total: 1000,
          ...Mock.mock({
            'customer|12': [{
              'id|+1': page * 10,
              "customername": "@cname",
              "customersex|1": ["男", "女", "未知"],
              "customercontact": "@cname",
              "customerbirthday": "@date",
              "customerphone": /^1[3456789]\d{9}$/,
              "customerprofile": "@csentence",
              "customeremail": /\w{5,10}@[a-z]{5}\.com/,
              "customerarea": "@city",
              "customerposition": "@ctitle",
              "creditcode": "@string('number', 18)",
              "customersource|1": ["电话营销", "网络营销", "推荐"],
              "followupstatus|1": ["初次沟通", "跟进中", "已签约"],
              "customerlevel|1": ["SSS", "AAA", "BBB"],
              "followuptime": "@date('yyyy-MM-dd')",
              "intentionalproduct|1": ["笔记本电脑", "平板电脑", "智能手机"],
              "founder": "@cname", // Random Chinese name for founder
              "followupdepartment|1": ["销售部", "市场部", "技术部"],
              "remark": "@csentence"
            }]
          })

        }
      }
    }
  },
  // 根据用户id返回对应用户记录
  {
    url: '/api/customer/mine/:id',
    method: 'get',
    response: ({ query }) => {
      return {
        code: 200,
        msg: 'ok',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'customer|1': [{
              'id|+1': Number(query.id ?? 1),
              "customername": "@cname",
              "customersex|1": ["男", "女", "未知"],
              "customercontact": "@cname",
              "customerbirthday": "@date",
              "customerphone": /^1[3456789]\d{9}$/,
              "customerprofile": "@csentence",
              "customeremail": /\w{5,10}@[a-z]{5}\.com/,
              "customerarea": ['11', '110101'],
              "customerposition": "@ctitle",
              "creditcode": "@string('number', 18)",
              "customersource|1": ["电话营销", "网络营销", "推荐"],
              "followupstatus|1": ["初次沟通", "跟进中", "已签约"],
              "customerlevel|1": ["SSS", "AAA", "BBB"],
              "followuptime": "@date('yyyy-MM-dd')",
              "intentionalproduct|1": ["笔记本电脑", "平板电脑", "智能手机"],
              "founder": "@cname", // Random Chinese name for founder
              "followupdepartment|1": ["销售部", "市场部", "技术部"],
              "remark": "@csentence"
            }]
          })
        }
      }
    }
  },
  //跟进提交
  {
    url: '/api/customer/mine/followup',
    method: 'post',
    response: () => {
      return {
        code: 200,
        msg: 'sucess',
        data: "跟进成功"
      }
    }
  },
  //编辑提交
  {
    url: '/api/customer/mine/edit',
    method: 'post',
    response: () => {
      return {
        code: 200,
        msg: 'sucess',
        data: "编辑成功"
      }
    }
  },
  // 跟进信息
  {
    url: '/api/customer/mine/followmessage/:id',
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'followmessage|4': [
              {
                'data': '@date("yyyy/MM/dd")',
                'name': '@cname',  // Chinese name
                'text': '@sentence',  // Random sentence
              }
            ]
          })
        }
      }
    }
  },
  // 合同信息
  {
    url: '/api/customer/mine/contractinmessage/:id',
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'contractinmessage|2': [
              {
                'contractNumber': 'YF' + Mock.Random.date('yyyyMMdd') + '-@integer(1, 100)',
                'contractName': '@ctitle(5, 10)',
                'customerName': '@cname',
                'contractAmount': '@integer(100000, 1000000)',
                'contractStatus': '已通过',
                'contractType': '@ctitle(5, 8)',
                'contractFile': 'XX销售合同.pdf',
                'relatedProduct': '@word(5, 10)',
                'signer': '@cname',
                'signDate': '@date',
                'expireDate': '@date("yyyy-MM-dd", "2024-08-23")',
                'paymentMethod': '银行卡',
                'advancePayment': '@integer(100000, 500000)',
                'note': '@cparagraph(2, 5)'
              }
            ]
          })
        }
      }
    }
  },
  // 回款信息
  {
    url: '/api/customer/mine/paymessage/:id',
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'paymessage|3': [
              {
                'id': 2,
                'PlannedPaymentTime': '@date("yyyy-MM-dd", "2024-08-23")',
                'PaymentMethod': '@word',
                'ReturnRatio': '@float(0, 1, 2)',
                'RefundAmount': '@float(1000, 5000, 2)',
                'PaymentInformation': '@sentence(5)',
                'remindertime': '@date("yyyy-MM-dd", "2024-08-23")',
                'reminderstate': "@csentence",
                'payPeople': "@csentence",
                'payDay': '@date("yyyy-MM-dd", "2024-08-23")',
                'payRemark': "@csentence",

              }
            ]
          })
        }
      }
    }
  },
  // 归属记录
  {
    url: '/api/customer/mine/vestmessage/:id',
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'vest|5-10': [
              {
                "currentOwnership": '@cname',
                "originalBelonging": '@ctitle(3, 5)',
                "operator": '@name',
                "endTime": '@datetime',
                "operationMethod": '@word(5, 10)',
                "startingTime": '@datetime',
                "operatingTime": '@date("yyyy-MM-dd", "2024-08-23")',
              }
            ]
          })
        }
      }
    }
  },
  // 附件信息
  {
    url: '/api/customer/mine/attatmessage/:id',
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'attainfo|5-10': [
              {
                'uploader': '@name',
                'accessoryname': '@word',
                'filesize': '@integer(1024, 4096)kB',
                'uploadtime': '@datetime',
                'operator': '@name',
                'illustrate': '@sentence',
                'operate': '@word'
              }
            ]
          })
        }
      }
    }
  },
  // 操作日志
  {
    url: '/api/customer/mine/logmessage/:id',
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: {
          ...Mock.mock({
            // 属性 users 的值是一个数组，其中含有 10 个元素
            'loginfo|5-10': [
              {
                'operate': '@word',
                'operationtype': '@word',
                'operationfield': '@word'
              }
            ]
          })
        }
      }
    }
  },
  //客户新增
  {
    url: '/api/customer/mine/end',
    method: 'post',
    response: () => {
      return {
        code: 200,
        msg: 'sucess',
        data: "结束了"
      }
    }
  },
  //客户删除
  {
    url: '/api/customer/mine/del',
    method: 'post',
    response: () => {
      return {
        code: 200,
        msg: 'sucess',
        data: "删除成功了"
      }
    }
  },

]